<template>
  <div id="homePage">
    <header id="homePage_header">
      <div class="homePage_left">
        <img src="./../login/logo.png" alt="">
      </div>
      <div class="homePage_right">
        <div class="homePage_right_options">
          <router-link class="active" v-for="route in $router.options.routes" :to="{ path: route.path }" v-if="route.menu">
            <div class="homePage_options_one">
              <i class="iconfont" v-html="route.iconFont"></i>
              <span>{{ route.name }}</span>
            </div>
          </router-link>
          <!-- <div class="homePage_options_one">
                    <i class="iconfont">&#xe892;</i>
                    <span>预测优化</span>
                </div> -->
        </div>
        <div class="homePage_right_usericon">
          <div>
            <span>admin</span>
            <span>在线</span>
          </div>
          <div>
            <span>格林豪泰集团</span>
          </div>
        </div>
      </div>
    </header>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  name: "homePage",
  data() {
    return {
      num: 1
    };
  },
  created() {
    //   alert(1)
    console.log(this.$router);
  }
};
</script>
<style lang="less">
html,
body {
  height: 100%;
}

a:hover,
a:visited,
a:link,
a:active {
  color: #3e2723;
}

#homePage {
  height: 100%;
  width: 100%;
  background: #ccc;
  // overflow: hidden;
  #homePage_header {
    height: 70px;
    width: 100%;
    background: #fff;
    display: flex;
    justify-content: space-between;
    overflow: hidden;
    border-bottom: 1px solid #ccc;
    .homePage_left {
      width: 20%;
      img {
        position: relative;
        top: 22px;
        margin-left: 20px;
        background-color: #ffb300;
      }
    }
    .homePage_right {
      display: flex;
      width: 46%;
      flex-wrap: wrap;
      background: #fff;
      .homePage_right_options {
        width: 80%;
        height: 70px;
        line-height: 70px;
        display: flex;
        justify-content: space-around;
        .active {
          display: inline-block;
          width: 100%;
          text-align: center;

          > div {
            width: 100%;
            text-align: center;
            cursor: pointer;
            i {
              position: relative;
              top: -10px;
              left: 31px;
              font-size: 30px;
            }
            .four,
            .six {
              left: 16px;
            }
            span {
              position: relative;
              top: 18px;
              left: -15px;
              font-size: 15px;
              color: #3e2723;
              font-family: "微软雅黑";
            }
          }
        }
      }
      .homePage_right_usericon {
        width: 20%;
        background: #ffffff;
        font-family: "微软雅黑";
        font-size: 15px;
        > div {
          text-align: center;
        }
        > div:nth-child(1) {
          margin-top: 15px;
          margin-bottom: 5px;
          span:nth-child(2) {
            margin-left: 10px;
            color: green;
            cursor: pointer;
          }
        }
      }
    }
  }
}

.router-link-active {
  background: #ffb300;
  i {
    color: #fff;
  }
  span {
    color: #fff !important;
  }
}
a:nth-child(3) div i {
  left: 19px !important;
}
</style>
